<?php defined('SYSPATH') OR die('No direct access allowed.');

class Validation extends Validation_Core {

	/**
	 * Add rules to a field. Validation rules may only return TRUE or FALSE and
	 * can not manipulate the value of a field.
	 *
	 * @chainable
	 * @param   string    field name
	 * @param   callback  rules (one or more arguments)
	 * @return  object
	 */
	public function add_massive_rules($fields, $rules)
	{
    		// Get the rules
		$rules = func_get_args();
		$rules = array_slice($rules, 1);

    if (!is_array($fields)) {
      foreach($rules as $rule)
        $this->add_rules($fields, $rule);
    }
    else foreach($fields as $field) {
      foreach($rules as $rule)
        $this->add_rules($field, $rule);
    }
    /*
    if (!is_array($fields)) call_user_func(array($this,'add_rules'), $fields, $rules);
    else foreach($fields as $field)
        call_user_func(array($this,'add_rules'),$field, $rules);*/
    //echo Kohana::debug($this);
    return $this;
  }
}